﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Fim_PayInPackEdit.aspx.cs" Inherits="KPIS.GERP.GFMS.APP.App_UI.Forms.Fim_PayInPackEdit" %> 

<%@ Register src="../UserControls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc1" %>

<asp:Content ID="Content2" runat="server" contentplaceholderid="head"> 
    <title>ข้อมูลการการโอนเงิน</title>
    <link href="../CssClass.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" src="../Scripts/Common.js" type="text/jscript"></script>
    <script language="JavaScript" src="../Scripts/DatePicker.js" type="text/jscript"></script> 
    <style type="text/css">
        .lbtExportX {
            cursor: pointer;
            color: midnightblue;
        }
        .auto-style3 {
            width: 165px;
        }
        .auto-style5 {
            width: 97px;
        }
        .auto-style6 {
            width: 252px;
        }
        .auto-style7 {
            width: 158px;
        }
    </style>
</asp:Content>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">

            function RowSelecting(rowObject) {
                //get the input check box
                var inputCheckBox = rowObject.Control.getElementsByTagName("input")[0];
                if (inputCheckBox.disabled) {
                    //cancel selection
                    return false;
                }
            }

            function OnTextChange(sender) {
                if (sender.get_value() == "") {
                    sender.set_text("");
                }
            }

            function txtBlur(tAmount, tExchangeRate)//, tBathAmount)
            {
                var txtAmount = $find(tAmount);
                var txtExchangeRate = $find(tExchangeRate);
                //var txtAmount = $find(tAmount);

                var dAmount = 0;
                var dExchangeRate = 0;
                //var dBathAmount = 0;

                if (txtAmount.get_value().toString().length > 0)
                    dAmount = txtAmount.get_value();

                if (txtExchangeRate.get_value().toString().length > 0)
                    dExchangeRate = txtExchangeRate.get_value();

                dAmount = dAmount * dExchangeRate;
                txtAmount.set_value(dAmount);
            }

            function OnRowSelected(tAmount, tExchangeRate, tAmount) {
                var txtAmount = $find(tAmount); 
                var dAmount = 0;
                var dExchangeRate = 0;
                var dAmount = 0;

                if (txtAmount.get_value().toString().length > 0)
                    dAmount = txtAmount.get_value();

                if (txtExchangeRate.get_value().toString().length > 0)
                    dExchangeRate = txtExchangeRate.get_value();

                dAmount = dAmount * dExchangeRate;
                txtAmount.set_value(dAmount);
            } 
        </script>
    </telerik:RadCodeBlock>  
    <div style="padding-top: 10px">
        <div class="moduleDivSlim1000">
            <div class="moduleDivBottom1000">
                <asp:Panel ID="PanelControl1" runat="server" CssClass="contentPaneDiv" Height="20px">
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="120px" class="controls">
                                <asp:LinkButton ID="cmdViewAll1" runat="server" CssClass="LinkButton" 
                                    onclick="cmdViewAll1_Click" CausesValidation="False">
                                    <img alt="" id="imgViewAll" runat="server" src="~/App_UI/Images/Buttons/Cancel.gif" /> ยกเลิกการแก้ไข
                                </asp:LinkButton>
                                <asp:LinkButton ID="cmdAddNew1" runat="server" CssClass="LinkButton" onclick="cmdAddNew1_Click">
                                    <img alt="" id="imgAddNew" runat="server" src="~/App_UI/Images/Buttons/AddRecord.gif" /> เพิ่มข้อมูลใหม่
                                </asp:LinkButton>
                            </td>
                            <td width="120px" class="controls">
                                <asp:LinkButton ID="cmdInsert1" runat="server" CssClass="LinkButton" onclick="cmdInsert1_Click" CausesValidation="true">
                                    <img alt="" id="imgInsert" runat="server" src="~/App_UI/Images/Buttons/saveDisk.gif" /> บันทึกข้อมูล
                                </asp:LinkButton>
                                <asp:LinkButton ID="cmdUpdate1" runat="server" CssClass="LinkButton" onclick="cmdUpdate1_Click" CausesValidation="true">
                                    <img alt="" id="imgUpdate" runat="server" src="~/App_UI/Images/Buttons/saveDisk.gif" /> บันทึกข้อมูล
                                </asp:LinkButton>
                                <asp:LinkButton ID="cmdEdit1" runat="server" CssClass="LinkButton" onclick="cmdEdit1_Click">
                                    <img alt="" id="imgEdit" runat="server" src="~/App_UI/Images/Buttons/Edit.gif" /> แก้ไขข้อมูล
                                </asp:LinkButton>
                            </td>
                            <td width="120px" class="controls">
                                <asp:LinkButton ID="cmdDelete1" runat="server" CssClass="LinkButton" onclick="cmdDelete1_Click"
                                    OnClientClick="javascript: return confirm('ต้องการลบรายการนี้หรือไม่?');">
                                    <img alt="" id="imgDelete" runat="server" src="~/App_UI/Images/Buttons/Delete.gif" /> ลบรายการที่เลือก
                                </asp:LinkButton>
                            </td>
                            <td width="100px" style="padding-left: 10px">
                                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" Visible="False" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
        </div>
        <div class="moduleContent1000">
            <div class="moduleDivBottom1000">
                <asp:Panel ID="Panel1" runat="server">
                    <asp:Panel ID="PanelRadGrid1" runat="server" CssClass="contentPaneDiv" Width="980px">
                        <table>
                            <tr>
                                <td>
                                    <asp:HiddenField runat="server" ID="hdf_pip_ref_no"/>
                                    <asp:HiddenField runat="server" ID="hdfFilterBgmSourceSeq"/>
                                    <asp:HiddenField runat="server" ID="hdfBgmYear"/>
                                    <asp:HiddenField runat="server" ID="hdfFilterWorkAreaSeq"/> 

                                </td>
                                <td>&nbsp;</td>
                            </tr>
                        </table>
                        <table width="972px" 
                        style="border: 1px solid #0000FF; background-image: url('../Images/PageViews/GridHeader.bmp'); background-repeat: repeat-x; color: #FFFFFF;">
                            <tr>
                                <td width="370px">&nbsp;&nbsp;<asp:Label ID="lblHeader" runat="server" Text="ข้อมูลรายการ Pay in pack" Font-Bold="true"></asp:Label>
                                </td>
                                <td align="right" width="100px">แหล่งเงิน :
                            </td>
                                <td width="125px">
                                    <telerik:RadComboBox ID="ddlFilterBgmSourceSeq" runat="server" AutoPostBack="true"
                                    DataTextField="bgm_source_name" DataValueField="bgm_source_seq" Filter="Contains"
                                    OnSelectedIndexChanged="ddlFilterBgmSourceSeq_SelectedIndexChanged">
                                    </telerik:RadComboBox>
                                </td>
                                <td align="right" width="20px">ปี :
                            </td>
                                <td width="50px">
                                    <telerik:RadNumericTextBox ID="txtBgmYear" runat="server"
                                    Width="100px" ShowSpinButtons="True" 
                                    NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator=""
                                    OnTextChanged="txtBgmYear_TextChanged" AutoPostBack="True" />
                                </td>
                                <td align="right" width="50px">เขตพื้นที่ :
                            </td>
                                <td >
                                    <telerik:RadComboBox ID="ddlFilterWorkAreaSeq" runat="server" AutoPostBack="true"
                                    DataTextField="work_area_name" DataValueField="work_area_seq" Filter="Contains"
                                    OnSelectedIndexChanged="ddlFilterWorkAreaSeq_SelectedIndexChanged">
                                    </telerik:RadComboBox>
                                </td>
                            </tr>
                        </table>
                            <%--OnItemCommand="RadGrid1_ItemCommand"--%>
                                    <%-- <telerik:GridBoundColumn DataField="currency_name" HeaderText="สกุลเงิน"
                                    HeaderStyle-Width="70px"
                                    UniqueName="currency_name" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                    CurrentFilterFunction="Contains" ShowFilterIc    on="False">
                                    <HeaderStyle Width="100px" />
                                </telerik:GridBoundColumn>--%><%--     <telerik:GridBoundColumn DataField="amount" HeaderText="จำนวนเงิน(บาท)"
                                    HeaderStyle-Width="100px"
                                    UniqueName="amount" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                    CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                    <HeaderStyle Width="100px" />
                                </telerik:GridBoundColumn>--%>
                        <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="RadGrid1" runat="server" AutoGenerateColumns="False" Skin="Outlook"
                        ShowStatusBar="True" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True"
                        Width="970px"  
                        GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                        GroupingSettings-GroupContinuedFormatString=""
                        GroupingSettings-GroupContinuesFormatString=""
                        GroupingSettings-GroupSplitFormat=""
                        OnNeedDataSource="RadGrid1_NeedDataSource" GridLines="None" CellSpacing="0" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged">
                            <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
                            DataKeyNames="pip_ref_no" NoMasterRecordsText="< ไม่มีข้อมูล >">
                                <CommandItemSettings ExportToPdfText="Export to PDF" />
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="bgm_source_seq" DataType="System.Int32" Display="False" HeaderText="bgm_source_seq" ReadOnly="True" UniqueName="bgm_source_seq" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="work_area_seq" DataType="System.Int32" Display="False" HeaderText="work_area_seq" ReadOnly="True" UniqueName="work_area_seq" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_year" DataType="System.Int32" Display="False" HeaderText="bgm_year" ReadOnly="True" UniqueName="bgm_year" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="pay_seq" DataType="System.Int32" FilterControlAltText="Filter pay_seq column" HeaderText="pay_seq" ReadOnly="True" UniqueName="pay_seq" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bank_acc_seq" DataType="System.Int32" Display="False" FilterControlAltText="Filter bank_acc_seq column" HeaderText="bank_acc_seq" ReadOnly="True" UniqueName="bank_acc_seq" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="record_status" Display="False" FilterControlAltText="Filter record_status column" HeaderText="record_status" ReadOnly="True" UniqueName="record_status" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="contact_seq" DataType="System.Int32" FilterControlAltText="Filter contact_seq column" HeaderText="contact_seq" ReadOnly="True" UniqueName="contact_seq" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" DataField="pip_date" DataFormatString="{0:d}" DataType="System.DateTime" FilterControlAltText="Filter pip_date column" FilterControlWidth="100%" HeaderText="วันที่" ShowFilterIcon="False" UniqueName="pip_date">
                                        <HeaderStyle Width="10%" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" DataField="pip_no" FilterControlAltText="Filter pip_no column" FilterControlWidth="100%" HeaderText="เลขที่ใบโอน" ShowFilterIcon="False" UniqueName="pip_no">
                                        <HeaderStyle Width="10%" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" DataField="pip_name" FilterControlAltText="Filter pip_name column" FilterControlWidth="100%" HeaderText="ชื่อรายการ" ShowFilterIcon="False" UniqueName="pip_name">
                                        <HeaderStyle Width="30%" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" DataField="bank_acc_name" FilterControlAltText="Filter bank_acc_name column" FilterControlWidth="100%" HeaderText="จากบัญชี" ShowFilterIcon="False" UniqueName="bank_acc_name">
                                        <HeaderStyle Width="20%" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="contact_name" FilterControlAltText="Filter contact_name column" HeaderText="ผู้รับเงิน" UniqueName="contact_name" ShowFilterIcon="False">
                                        <HeaderStyle Width="10%" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" DataField="net_amount" DataType="System.Double" FilterControlAltText="Filter net_amount column" FilterControlWidth="100%" HeaderText="จำนวนเงิน" ShowFilterIcon="False" UniqueName="net_amount">
                                        <HeaderStyle Width="10%" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="record_status_name" HeaderText="สถานะ"
                                    HeaderStyle-Width="80px"
                                    UniqueName="record_status_name" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                    CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                        <HeaderStyle Width="10%" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="fee_amount" DataType="System.Double" Display="False" FilterControlAltText="Filter fee_amount column" HeaderText="fee_amount" UniqueName="fee_amount" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="work_area_name" Display="False" FilterControlAltText="Filter work_area_name column" HeaderText="work_area_name" UniqueName="work_area_name" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="bgm_source_name" Display="False" FilterControlAltText="Filter bgm_source_name column" HeaderText="bgm_source_name" UniqueName="bgm_source_name" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="created_by" DataType="System.Int32" Display="False" FilterControlAltText="Filter created_by column" HeaderText="created_by" UniqueName="created_by" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="created_when" DataType="System.DateTime" Display="False" FilterControlAltText="Filter created_when column" HeaderText="created_when" UniqueName="created_when" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="updated_when" DataType="System.DateTime" Display="False" FilterControlAltText="Filter updated_when column" HeaderText="updated_when" UniqueName="updated_when" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="updated_by" DataType="System.Int32" Display="False" FilterControlAltText="Filter updated_by column" HeaderText="updated_by" UniqueName="updated_by" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn FilterControlAltText="Filter pip_ref_no column" HeaderText="pip_ref_no" UniqueName="pip_ref_no" Visible="False" DataField="pip_ref_no" ReadOnly="True">
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                                <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                                FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                                NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                                PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                            </MasterTableView>
                            <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                            GroupContinuedFormatString="" GroupContinuesFormatString="" 
                            GroupSplitFormat="" />
                            <ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick="true">
                                <Selecting AllowRowSelect="True" />
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                            </ClientSettings>
                            <FilterMenu EnableImageSprites="False">
                            </FilterMenu>
                        </telerik:RadGrid>
                    </asp:Panel>
                    <asp:Panel ID="PanelEdit1" runat="server" Visible="false"  >
                        <ul class="formList" style="width: 910px">
                            <li>
                                <table width="100%">
                                    <tr>
                                        <td class="TextHeader">ข้อมูลการโอน Pay In Pack
                                    </td>
                                        <td align="right" class="TextHeader">
                                            <asp:Label ID="lblBgmSourceName" runat="server" />
                                            &nbsp;&nbsp;
                                            <asp:Label ID="lblBgmYear" runat="server" />
                                        </td>
                                    </tr>
                                </table>
                            </li>
                            <li>
                                <table width="900px">
                                    <tr>
                                        <td align="center">
                                            <asp:Panel ID="Panel2" runat="server" HorizontalAlign="Left" Width="800px">
                                                <asp:Label ID="Label1" runat="server" class="TextHeader" Text="ข้อมูลรายการจ่ายเงินที่ยังไม่ได้โอน"> </asp:Label>
                                                <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="RadGrid2" runat="server" AutoGenerateColumns="False" AllowMultiRowSelection="True" Skin="Outlook"
                                                    ShowStatusBar="True" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True"
                                                    Width="850px" 
                                                    GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                    GroupingSettings-GroupContinuedFormatString=""
                                                    GroupingSettings-GroupContinuesFormatString=""
                                                    GroupingSettings-GroupSplitFormat=""
                                                    OnItemCommand="RadGrid2_ItemCommand" CellSpacing="0" GridLines="None" style="margin-left: 0px"
                                                    OnEditCommand="RadGrid2_EditCommand" OnColumnCreated="RadGrid2_ColumnCreated" OnItemCreated="RadGrid2_ItemCreated"
                                                    OnItemDataBound="RadGrid2_ItemDataBound">
                                                    <%--OnDetailTableDataBind="RadGrid2_DetailTableDataBind" OnItemDataBound="RadGrid2_ItemDataBound"--%>
                                                    <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" CommandItemDisplay="Top"
                                                DataKeyNames="pay_seq" NoMasterRecordsText="< ไม่มีข้อมูล >">
                                                        <CommandItemSettings ShowExportToWordButton="false" 
                                                            ShowExportToExcelButton="false" ShowAddNewRecordButton="false" ShowRefreshButton="false"
                                                            ShowExportToCsvButton="false" ShowExportToPdfButton="false">
                                                        </CommandItemSettings>
                                                        <CommandItemTemplate>
                                                            <table width="100%">
                                                                <tr>
                                                                    <td>
                                                                        <asp:Label ID="lblHeader" runat="server" Text="ข้อมูลรายการจ่ายเงินที่ยังไม่ได้โอน"> </asp:Label>
                                                                    </td> 
                                                                    <td></td>
                                                                    <td style="width:120px">
                                                                        <asp:LinkButton runat="server" Text="xxx"></asp:LinkButton>
                                                                        <a onclick="javascript:ExportPayInPack('DetailReportPib');" class="lbtExportX" data-reportname="DetailReportPib" runat="server" title="Excel รายละเอียด">
                                                                            <img src="~/App_UI/Images/Buttons/excel-icon.png" runat="server" alt="ExportExcelDetail"/>
                                                                            Excel รายละเอียด 
                                                                        </a> 
                                                                    </td>
                                                                    <td style="width:140px">
                                                                        <a onclick="javascript:ExportPayInPack('BankFixLength');" class="lbtExportX" data-reportname="BankFixLength" runat="server" title="โหลดข้อมูล PayInPack">
                                                                            <img src="~/App_UI/Images/Buttons/box_green.gif" runat="server" alt="ExportExcelGreen"/>
                                                                            โหลดข้อมูล PayInPack 
                                                                        </a> 
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </CommandItemTemplate> 
                                                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                                                        <RowIndicatorColumn>
                                                            <HeaderStyle Width="20px" />
                                                        </RowIndicatorColumn>
                                                        <ExpandCollapseColumn>
                                                            <HeaderStyle Width="20px" />
                                                        </ExpandCollapseColumn>
                                                        <%--<DetailTables>
                                                    <telerik:GridTableView ClientDataKeyNames="receive_dtls_seq" DataKeyNames="receive_dtls_seq" HierarchyLoadMode="ServerOnDemand"
                                                        AllowFilteringByColumn="false" AllowSorting="false">
                                                        <ParentTableRelation>
                                                            <telerik:GridRelationFields DetailKeyField="receive_seq" MasterKeyField="receive_seq" />
                                                        </ParentTableRelation>
                                                        <Columns>
                                                            <telerik:GridBoundColumn HeaderText="receive_dtls_seq" Visible="false"
                                                                UniqueName="receive_dtls_seq" DataField="receive_dtls_seq">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn SortExpression="receive_dtls_name" HeaderText="รายละเอียด"
                                                                DataField="receive_dtls_name">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridTemplateColumn UniqueName="amount" HeaderText="จำนวนเงิน"
                                                                ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" HeaderStyle-Width="100px">
                                                                <ItemTemplate>
                                                                    <telerik:RadNumericTextBox ID="txtAmount" runat="server" Width="95px" CssClass="NumericTextBox"
                                                                        Value='<%# DataBinder.Eval( Container, "DataItem.amount"  ) %>' ReadOnly="true">
                                                                    </telerik:RadNumericTextBox>
                                                                </ItemTemplate>
                                                            </telerik:GridTemplateColumn>
                                                            <telerik:GridBoundColumn SortExpression="currency_name" HeaderText="สกุลเงิน"
                                                                DataField="currency_name" HeaderStyle-Width="100px">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridTemplateColumn UniqueName="exchange_rate" HeaderText="อัตรา"
                                                                ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" HeaderStyle-Width="50px">
                                                                <ItemTemplate>
                                                                    <telerik:RadNumericTextBox ID="txtExchangeRate" runat="server" Width="45px" CssClass="NumericTextBox"
                                                                        Value='<%# (DataBinder.Eval( Container, "DataItem.exchange_rate"  ).ToString().Length > 0 ? DataBinder.Eval( Container, "DataItem.exchange_rate"  ) : "1") %>'>
                                                                    </telerik:RadNumericTextBox>
                                                                </ItemTemplate>
                                                            </telerik:GridTemplateColumn>
                                                            <telerik:GridTemplateColumn UniqueName="bath_amount" HeaderText="คิดเป็นเงินบาท"
                                                                ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" HeaderStyle-Width="100px">
                                                                <ItemTemplate>
                                                                    <telerik:RadNumericTextBox ID="txtBathAmount" runat="server" Width="95px" CssClass="NumericTextBox"
                                                                        ReadOnly="true" ForeColor="Blue"
                                                                        Value='<%# DataBinder.Eval( Container, "DataItem.bath_amount"  ) %>'>
                                                                    </telerik:RadNumericTextBox>
                                                                </ItemTemplate>
                                                            </telerik:GridTemplateColumn>
                                                        </Columns>
                                                    </telerik:GridTableView>
                                                </DetailTables>--%>
                                                        <Columns>
                                                            <%--<telerik:GridBoundColumn DataField="currency_name" HeaderText="สกุลเงิน"
                                                        UniqueName="currency_name" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                        CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                                    </telerik:GridBoundColumn>--%>
                                                            <telerik:GridBoundColumn DataField="pay_seq" DataType="System.Int32" Display="False" FilterControlAltText="Filter pay_seq column" HeaderText="pay_seq" ReadOnly="True" UniqueName="pay_seq" Visible="False">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="contact_seq" DataType="System.Int32" Display="False" FilterControlAltText="Filter contact_seq column" HeaderText="contact_seq" ReadOnly="True" UniqueName="contact_seq" Visible="False" EmptyDataText="" ShowFilterIcon="False">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="to_bank_acc_id" DataType="System.Int32" Display="False" EmptyDataText="" FilterControlAltText="Filter to_bank_acc_id column" HeaderText="to_bank_acc_id" ReadOnly="True" ShowFilterIcon="False" UniqueName="to_bank_acc_id" Visible="False">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="method_seq" DataType="System.Int32" FilterControlAltText="Filter method_seq column" HeaderText="method_seq" UniqueName="method_seq" Visible="False">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridClientSelectColumn HeaderStyle-Width="30px" UniqueName="ClientSelectColumn">
                                                                <HeaderStyle Width="30px" />
                                                            </telerik:GridClientSelectColumn>
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="pay_date" DataFormatString="{0:d}" DataType="System.DateTime" FilterControlAltText="Filter pay_date column" FilterControlWidth="100%" HeaderStyle-Width="65px" HeaderText="วันที่รายการ" ShowFilterIcon="False" UniqueName="pay_date" EmptyDataText="">
                                                                <HeaderStyle Width="100px" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="True" DataField="pay_name" FilterControlAltText="Filter pay_name column" HeaderText="ชื่อรายการจ่าย" ShowFilterIcon="False" UniqueName="pay_name">
                                                                
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="contact_name" FilterControlAltText="Filter contact_name column" FilterControlWidth="100%" HeaderText="ชื่อเจ้าหนี้" ShowFilterIcon="False" UniqueName="contact_name">
                                                                <HeaderStyle Width="200px" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="to_bank_acc_name" FilterControlAltText="Filter to_bank_acc_name column" FilterControlWidth="100%" HeaderStyle-Width="70px" HeaderText="ชื่อบัญชีเจ้าหนี้" ShowFilterIcon="False" UniqueName="to_bank_acc_name" EmptyDataText="">
                                                                <HeaderStyle Width="200px" />
                                                                <ItemStyle Width="500px" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="amount" DataFormatString="{0:n2}" DataType="System.Double" FilterControlWidth="100%" HeaderStyle-Width="100px" HeaderText="จำนวนเงิน(บาท)" ItemStyle-HorizontalAlign="Right" ShowFilterIcon="False" UniqueName="amount">
                                                                <HeaderStyle Width="100px" />
                                                                <ItemStyle HorizontalAlign="Right" />
                                                            </telerik:GridBoundColumn>
                                                        </Columns>
                                                        <EditFormSettings>
                                                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                            </EditColumn>
                                                        </EditFormSettings>
                                                        <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" 
                                                    FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                                                    NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                                                    PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                                                    </MasterTableView>
                                                    <GroupingSettings CaseSensitive="False" GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" GroupContinuedFormatString="" GroupContinuesFormatString="" GroupSplitFormat="" />
                                                    <ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick="true">
                                                        <Selecting AllowRowSelect="true" />
                                                        <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                                        <ClientEvents OnRowSelected="RowSelecting" />
                                                    </ClientSettings>
                                                    <FilterMenu EnableImageSprites="False">
                                                    </FilterMenu>
                                                </telerik:RadGrid>
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                </table>
                            </li>
                            <li>
                                <table>
                                    <tr>
                                        <td align="right" width="200px">จำนวนเงินรวม :
                                    </td>
                                        <td width="250px">
                                            <asp:Label ID="lblAmount" runat="server" Text="0" ForeColor="blue">
                                        </asp:Label>
                                            &nbsp;<asp:Label ID="lblAmountEdit" runat="server" ForeColor="Blue" Text="0"></asp:Label>
                                            บาท
                                            <asp:Label ID="lblTempPipRefNo" runat="server" Visible="False"></asp:Label>
                                        </td>
                                        <td align="right" width="100px">&nbsp;</td>
                                        <td>
                                            <telerik:RadNumericTextBox ID="txtOtherAmount" runat="server" Visible="False"
                                             />
                                            &nbsp;
                                    </td>
                                    </tr>
                                </table>
                            </li>
                            <li>
                                <table style="height: 17px; width: 791px;">
                                    <tr >
                                        <td align="right" class="auto-style3">เลขที่ใบโอน :
                                    </td>
                                        <td class="auto-style6" >
                                            <telerik:RadTextBox ID="txtRefNo" Runat="server">
                                            </telerik:RadTextBox>
                                            <span class="span">*</span>
                                            <asp:RequiredFieldValidator ID="reqRefNo" runat="server" 
                                            ControlToValidate="txtRefNo">
                                            <asp:Image runat="server" id="Image2" ImageUrl="~/App_UI/Images/Buttons/warning.png"
                                                ToolTip="กรุณากรอกข้อมูล" />
                                        </asp:RequiredFieldValidator>
                                        </td>
                                        <td align="right" class="auto-style5">วันที่จ่ายจริง :
                                    </td>
                                        <td style="width:140px;text-align:left;">
                                            <uc1:DatePicker ID="dpTransferDate" runat="server" />
                                            <%--<asp:RequiredFieldValidator ID="reqTransferDate" runat="server" 
                                            ControlToValidate="txtTransferDate">
                                            <asp:Image runat="server" id="Image3" ImageUrl="~/App_UI/Images/Buttons/warning.png"
                                                ToolTip="กรุณากรอกข้อมูล" />
                                        </asp:RequiredFieldValidator>--%></td>
                                        <td><span class="span">*</span></td>
                                    </tr>
                                </table>
                            </li>
                            <li>
                                <table style="width: 729px">
                                    <tr>
                                        <td align="right" >บัญชีเงินจ่ายเลขที่ :
                                    </td>
                                        <td width="250px">
                                            <telerik:RadComboBox ID="ddlToBankAccSeq" runat="server"
                                            DataTextField="bank_acc_name" DataValueField="bank_acc_seq"
                                            DropDownWidth="400px" Filter="Contains" AutoPostBack="True" 
                                            CausesValidation="false">
                                            </telerik:RadComboBox>
                                            <span class="span">*</span>
                                            <asp:RequiredFieldValidator ID="reqToBankAccSeq" runat="server" 
                                            ControlToValidate="ddlToBankAccSeq">
                                            <asp:Image runat="server" id="Image4" ImageUrl="~/App_UI/Images/Buttons/warning.png"
                                                ToolTip="กรุณากรอกข้อมูล" />
                                        </asp:RequiredFieldValidator>
                                        </td>
                                        <td align="right" width="100px">ชื่อรายการจ่ายเงิน :
                                    </td>
                                        <td>
                                            <telerik:RadTextBox ID="txtTransferName" Runat="server" Width="150px">
                                            </telerik:RadTextBox>
                                            <td></td>
                                        </td>
                                    </tr>
                                </table>
                            </li>
                            <asp:Panel ID="PanelBankAccType" runat="server" Visible="false">
                                <li>
                                    <table>
                                        <tr>
                                            <td align="right" width="200px"></td>
                                            <td>
                                                <asp:RadioButtonList ID="rblBankAccTypeSeq" runat="server" RepeatDirection="Horizontal"
                                                DataTextField="bank_acc_type_name" DataValueField="bank_acc_type_seq">
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                            </asp:Panel>
                            <li class="lastListItem">
                                <table>
                                    <tr>
                                        <td align="right" width="200px" valign="top">ผู้นำจ่ายเงิน :
                                    </td>
                                        <td>
                                            <asp:Label ID="lblEmpName" runat="server">
                                        </asp:Label>
                                            <asp:Label ID="lblEmpSeq" runat="server" Visible="false">
                                        </asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </li>
                        </ul>
                    </asp:Panel>
                    <asp:Panel ID="PanelEdit2" runat="server" Visible="false" >
                        <ul class="formList" style="width: 910px">
                            <li>
                                <table width="100%">
                                    <tr>
                                        <td class="TextHeader">ข้อมูลการถอนเงิน
                                    </td>
                                        <td align="right" class="TextHeader">&nbsp;&nbsp;
                                            </td>
                                    </tr>
                                </table>
                            </li>
                            <li>
                                <table>
                                    <tr>
                                        <td align="right" width="200px">&nbsp;</td>
                                        <td width="250px">&nbsp;</td>
                                        <td align="right" width="100px">&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                </table>
                            </li>
                            <li>
                                <table>
                                    <tr>
                                        <td align="right" width="200px">&nbsp;</td>
                                        <td width="250px">&nbsp;</td>
                                        <td align="right" width="100px">&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                </table>
                            </li>
                            <li class="lastListItem">
                                <table>
                                    <tr>
                                        <td align="right" width="200px">&nbsp;</td>
                                        <td width="250px">&nbsp;</td>
                                        <td align="right" width="100px">&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                </table>
                            </li>
                        </ul>
                    </asp:Panel>
                </asp:Panel>
            </div>
        </div>
    </div>
</asp:Content>